<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:s="http://jboss.com/products/seam/taglib"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:a4j="http://richfaces.org/a4j"
	template="/pages/templates/templateMain.xhtml">

	<ui:param name="browser_tab_title" value="Edit Customer" />
	<ui:param name="page_title"
		value="Add new customer / Edit existing customer" />

	<ui:define name="content">

		<p:panel>
			<f:facet name="header">
				<h:outputText value="Customer Form" />
			</f:facet>

			<h:form id="customerForm">
				<h:panelGrid columns="3">
					<h:outputLabel value="First Name:*" />
					<h:inputText value="#{customer.firstName}" id="firstName">
						<rich:ajaxValidator summary="Invalid first name" event="onblur" />
					</h:inputText>
					<rich:message for="firstName" />

					<h:outputLabel value="Last Name:*" />
					<h:inputText value="#{customer.lastName}" id="lastName">
						<rich:ajaxValidator summary="Invalid last name" event="onblur" />
					</h:inputText>
					<rich:message for="lastName" />

					<h:outputLabel value="Birth Date:*" />
					<h:panelGrid columns="3">
						<h:selectOneMenu value="#{dateHelper.day}">
							<f:selectItems value="#{dateUtil.getDayItems(1, 1900)}" />
						</h:selectOneMenu>

						<h:selectOneMenu value="#{dateHelper.month}">
							<f:selectItems value="#{dateUtil.getMonthItems()}" />
						</h:selectOneMenu>

						<h:selectOneMenu value="#{dateHelper.year}">
							<f:selectItems value="#{dateUtil.getYearItems()}" />
						</h:selectOneMenu>
					</h:panelGrid>
					<br />

					<h:outputLabel value="Gender:*" />
					<h:selectOneMenu value="#{customer.gender}">
						<f:selectItem itemLabel="Male" itemValue="M" />
						<f:selectItem itemLabel="Female" itemValue="F" />
					</h:selectOneMenu>
					<br />

					<h:outputLabel value="PIN:*" />
					<h:inputText value="#{customer.pin}" id="pin">
						<rich:ajaxValidator summary="Invalid PIN" event="onblur" />
					</h:inputText>
					<rich:message for="pin" />
				</h:panelGrid>

				<br />
				<h:outputLabel value="* required fields." />
				<br />
				<br />
				<p:commandButton id="buttonCancel" value="Cancel" action="cancel"
					immediate="true" ajax="false" />
				<p:commandButton id="buttonNext" value="Next" action="next"
					ajax="false" />
				<p:commandButton id="buttonFinish" value="Finish" action="finish"
					ajax="false" />
			</h:form>
		</p:panel>

	</ui:define>
</ui:composition>